import { version } from '../../package.json';
import { Router } from 'express';
import user from './user';
import factory from './factory'
import order from './order'
import photo from './photo'

export default ({ config, db }) => {
  let api = Router();

  // mount the facets resource
  api.use('/user', user);
  api.use('/factory', factory);
  api.use('/order', order);
  api.use('/photo', photo);


  // perhaps expose some API metadata at the root
  api.get('/', (req, res) => {
    res.json({ version });
  });

  return api;
}
